package com.alex.formates;

import android.graphics.Paint;
import android.graphics.Typeface;
import android.graphics.Paint.FontMetrics;

/**
 * 
 * 阅读的格式设置
 * 
 * @author Alex.Lu
 *
 */
public class ReaderFormat {
	
	/**
	 * 显示行数
	 */
	public int mLineCount;
	public int mPageW;
	public int mPageH;
	public float mSpace;
	public String mStrCharsetName;
	public Paint mPaint;
	public String mFamilyName;
	public int mStyle;
	
	public ReaderFormat(){
		mStyle = Typeface.NORMAL;
	}
	
	/**
	 * 
	 */
	public void setUp(){
		FontMetrics fm = mPaint.getFontMetrics();
		mLineCount = mPageH / (int)(Math.ceil(fm.bottom - fm.ascent)+mSpace/2+0.5);
	}
}
